<!DOCTYPE html>
<html lang="en">
<head>
    <{include file="header.html"}>
    <title>网校管理-<{$user_data['school_name']}>-德安信会计在线教育平台</title>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=hr20tx53PVWOwhMWxkipwE7tN1pstQ1S"></script>
</head>
<body>
<div class="wrap">
    <!--star left-->
    <div class="column">
        <{include file="left_menu.html"}>
    </div>
    <div id="ContMianBox">
       <!--star子栏目-->
            <div class="sub-colum">
                <div class="tit"><{$left_menu_min.menu}></div>
                <ul>
                    <{foreach from=$left_menu_min.list item=item}>
                    <li <{if $item['url'] == $left_menu_min.curr}>class="curr"<{/if}>><a href="<{$item['url']}>"><{$item['name']}></a></li>
                    <{/foreach}>
                </ul>
            </div>
        <!--end子栏目-->
        <!--end left-->
        <div class="container narrow">
            <!--star conter-->
            <div class="cetContent">
                <div class="tit p-lr20">
                    <span class="curr"><a href="/setting/info">学校基本信息</a></span>
                </div>
                <!--star内容区域-->
                <div class="mainScroll">
                    <div class="mainContainer line-all">
                        <!--star tabMainCont-->
                        <div class="tabMainCont">
                            <form class="layui-form" method="post" enctype="multipart/form-data">
                                <div class="layui-form-item">
                                    <label class="layui-form-label">学校名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" id="school_name" name="school_name" value="<{$info.school_name|default:''}>" style="width: 400px;" lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label class="layui-form-label">学校简称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="ad_name" name="school_nick" value="<{$info.school_nick|default:''}>" lay-verify="required" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">校长姓名</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="xiaozhang" value="<{$info.xiaozhang|default:''}>" lay-verify="required|username" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系人</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="link_man" value="<{$info.link_man|default:''}>" lay-verify="required|username" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">固定电话</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="link_tel" value="<{$info.link_tel|default:''}>" autocomplete="off" lay-verify="tel" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">联系手机号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="link_phone" value="<{$info.link_phone|default:''}>" autocomplete="off" lay-verify="phone" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">客服邮箱</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="email" value="<{$info.email|default:''}>" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">备案号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="record_number" value="<{$info.record_number|default:''}>" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">首页标题</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="index_seo_title" style="width: 400px;" value="<{$info.index_seo_title|default:''}>" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">分享文字</label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="wx_share_text" style="width: 400px;" value="<{$info.wx_share_text|default:''}>" autocomplete="off" class="layui-input">
                                    </div>
                                </div> 

                                <div class="layui-form-item layui-form-text">
                                    <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                    <label class="layui-form-label">分享Logo<br/>200x200(px)</label>
                                    <div class="layui-input-block" style="margin-top: 5px;">
                                        <div id="uploader6" class="upload_box" style="float:left; width:420px;">
                                            <div class="queueList">
                                                <div id="dndArea6" class="placeholder dndArea">
                                                    <div id="filePicker6" class="filePicker"></div>
                                                    <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePickerBut6" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                            <div class="upload_img_input" input_name='wx_share_logo'></div>
                                        </div>
                                        <{if isset($info['wx_share_logo']) AND $info['wx_share_logo'] != ''}>
                                            <div class="layui-inline" style="float:left;"><img src="<{$info['wx_share_logo']}>" style="max-height:175px;"/></div>
                                        <{/if}>
                                    </div>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                    <label class="layui-form-label">学校Logo</label>
                                    <div class="layui-input-block" style="margin-top: 5px;">
                                        <div id="uploader1" class="upload_box" style="float:left; width:420px;">
                                            <div class="queueList">
                                                <div id="dndArea1" class="placeholder dndArea">
                                                    <div id="filePicker1" class="filePicker"></div>
                                                    <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePickerBut1" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                            <div class="upload_img_input" input_name='school_logo'></div>
                                        </div>
                                        <{if isset($info['school_logo']) AND $info['school_logo'] != ''}>
                                            <div class="layui-inline" style="float:left;"><img src="<{$info['school_logo']}>" style="max-height:175px;"/></div>
                                        <{/if}>
                                    </div>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                    <label class="layui-form-label">班主任二维码</label>
                                    <div class="layui-input-block" style="margin-top: 5px;">
                                        <div id="uploader2" class="upload_box" style="float:left; width:420px;">
                                            <div class="queueList">
                                                <div id="dndArea2" class="placeholder dndArea">
                                                    <div id="filePicker2" class="filePicker"></div>
                                                    <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePickerBut2" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                            <div class="upload_img_input" input_name='wx_manager_qrcode'></div>
                                        </div>
                                        <{if isset($info['wx_manager_qrcode']) AND $info['wx_manager_qrcode'] != ''}>
                                            <div class="layui-inline" style="float:left;"><img src="<{$info['wx_manager_qrcode']}>" style="max-height:175px;"/></div>
                                        <{/if}>
                                    </div>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                    <label class="layui-form-label">公众号二维码</label>
                                    <div class="layui-input-block" style="margin-top: 5px;">
                                        <div id="uploader3" class="upload_box" style="float:left; width:420px;">
                                            <div class="queueList">
                                                <div id="dndArea3" class="placeholder dndArea">
                                                    <div id="filePicker3" class="filePicker"></div>
                                                    <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePickerBut3" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                            <div class="upload_img_input" input_name='wx_mp_qrcode'></div>
                                        </div>
                                        <{if isset($info['wx_mp_qrcode']) AND $info['wx_mp_qrcode'] != ''}>
                                            <div class="layui-inline" style="float:left;"><img src="<{$info['wx_mp_qrcode']}>" style="max-height:175px;"/></div>
                                        <{/if}>
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">学校地址</label>
                                    <div class="layui-input-inline">
                                        <select name="province_code" id="province" lay-filter="province" lay-verify="required">
                                            <option value="">请选择省</option>
                                            <{foreach from=$province_list item=item }>
                                            <option value="<{$item['area_code']}>" <{if isset($info) && $info['province_code']==$item['area_code'] }>selected<{/if}> ><{$item['area_name']}></option>
                                            <{/foreach}>
                                        </select>
                                    </div>
                                   
                                    <div class="layui-input-inline">
                                        <select name="city_code" id="city" lay-filter="city" lay-verify="required">
                                            <option value="">请选择市</option>
                                            <{if isset($city_list)}>
                                            <{foreach from=$city_list item=item }>
                                            <option value="<{$item['area_code']}>" <{if isset($info) && $info['city_code']==$item['area_code'] }>selected<{/if}> ><{$item['area_name']}></option>
                                            <{/foreach}>
                                            <{/if}>
                                        </select>
                                    </div>

                                    <div class="layui-input-inline">
                                        <select name="area_code" id="district" lay-filter="district" lay-verify="required">
                                            <option value="">请选择区</option>
                                            <{if isset($area_list)}>
                                            <{foreach from=$area_list item=item }>
                                            <option value="<{$item['area_code']}>" <{if isset($info) && $info['area_code']==$item['area_code'] }>selected<{/if}> ><{$item['area_name']}></option>
                                            <{/foreach}>
                                            <{/if}>
                                        </select>
                                    </div>
                                    <input type="hidden" name="province_name" id="province_name" value="<{$info['province_name']|default:''}>"/>
                                    <input type="hidden" name="city_name" id="city_name" value="<{$info['city_name']|default:''}>"/>
                                    <input type="hidden" name="area_name" id="area_name" value="<{$info['area_name']|default:''}>"/>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">详细地址</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="school_address" value="<{$info.school_address|default:''}>" autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label class="layui-form-label">经纬度</label>
                                    <div class="layui-input-block">
                                        <input type="text" name="lgn_lat" id="lgn_lat" value="<{if $info.longitude > 0 AND $info.latitude > 0}><{$info.longitude}>,<{$info.latitude}><{/if}>" autocomplete="off" class="layui-input" readonly="readonly">
                                    </div>  
                                    <div class="layui-input-block" style="width:800px;height:400px" id="allmap"></div>  
                                    <script type="text/javascript">
                                        // 百度地图API功能
                                        var map = new BMap.Map("allmap");
                                        var point = new BMap.Point(116.331398,39.897445);
                                        map.centerAndZoom(point,12);
                                        map.enableScrollWheelZoom(true);
                                        var geolocation = new BMap.Geolocation();
                                        geolocation.getCurrentPosition(function(r){
                                            if(this.getStatus() == BMAP_STATUS_SUCCESS){
                                                <{if $info.longitude > 0 AND $info.latitude > 0}>
                                                r.point.lng = "<{$info.longitude}>";
                                                r.point.lat = "<{$info.latitude}>";
                                                <{/if}>
                                                var mk = new BMap.Marker(r.point);
                                                map.addOverlay(mk);
                                                map.panTo(r.point);
                                                $("#lgn_lat").val(r.point.lng + ", " + r.point.lat)
                                                mk.enableDragging();
                                                //标注拖拽后的位置
                                                mk.addEventListener("dragend", function (e) {
                                                   // alert("当前位置：" + e.point.lng + ", " + e.point.lat);
                                                   $("#lgn_lat").val(e.point.lng + ", " + e.point.lat)
                                                });
                                                
                                            }else {
                                                alert('failed'+this.getStatus());
                                            }
                                        },{enableHighAccuracy: true})
                                    </script>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                    <label class="layui-form-label">首页终身成长模块图</label>
                                    <div class="layui-input-block" style="margin-top: 5px;">
                                        <div id="uploader4" class="upload_box" style="float:left; width:420px;">
                                            <div class="queueList">
                                                <div id="dndArea4" class="placeholder dndArea">
                                                    <div id="filePicker4" class="filePicker"></div>
                                                    <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePickerBut4" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                            <div class="upload_img_input" input_name='grow_up'></div>
                                        </div>
                                        <{if isset($info['grow_up']) AND $info['grow_up'] != ''}>
                                            <div class="layui-inline" style="float:left;"><img src="<{$info['grow_up']}>" style="max-height:175px;"/></div>
                                        <{/if}>
                                    </div>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <input type="hidden" id="token" value="<{'VIMG'|get_qiniu_token}>" />
                                    <label class="layui-form-label">首页我们的服务模块图</label>
                                    <div class="layui-input-block" style="margin-top: 5px;">
                                        <div id="uploader5" class="upload_box" style="float:left; width:420px;">
                                            <div class="queueList">
                                                <div id="dndArea5" class="placeholder dndArea">
                                                    <div id="filePicker5" class="filePicker"></div>
                                                    <p>或将照片拖到这里，最多可上传<script>document.write(fileNumLimit);</script>张图片</p>
                                                </div>
                                            </div>
                                            <div class="statusBar" style="display:none;">
                                                <div class="progress">
                                                    <span class="text">0%</span>
                                                    <span class="percentage"></span>
                                                </div><div class="info"></div>
                                                <div class="btns">
                                                    <div id="filePickerBut5" class="filePickerBut"></div><div class="uploadBtn">开始上传</div>
                                                </div>
                                            </div>
                                            <div class="upload_img_input" input_name='service'></div>
                                        </div>
                                        <{if isset($info['service']) AND $info['service'] != ''}>
                                            <div class="layui-inline" style="float:left;"><img src="<{$info['service']}>" style="max-height:175px;"/></div>
                                        <{/if}>
                                    </div>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">学校简介</label>
                                    <div class="layui-input-block">
                                        <textarea class="layui-textarea" name="school_intro"><{$info.school_intro|default:""}></textarea>
                                    </div>
                                </div>

                                <div class="layui-form-item layui-form-text">
                                    <label class="layui-form-label">详细描述</label>
                                    <div class="layui-input-block">
                                        <textarea class="layui-textarea" name="description"><{$info.description|default:""}></textarea>
                                    </div>
                                </div>

                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="*">立即提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </div>

                            </form>

                        </div>
                        <!--star会员管理-->
                    </div>
                        <!--end tabMainCont-->
                </div>

            </div>
        </div>

    </div>
</div>
<{include file="footer.html"}>
<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form();
        form.on('select(province)',function(data){
            var ii = layer.load();
            var province_code = data.value;
            $("#province_name").val($("#province option:selected").text())
            $("#city_name").val('');
            $("#area_name").val('');
            $("#city").html('<option value="">请选择城市</option>');
            $("#district").html('<option value="">请选择区域</option>');
            form.render('select');
            $.ajax({
                type: "GET",
                url: "/area/get_area_by_parent/"+province_code,
                dataType:"json",
                success: function(result){
                    var html ='';
                    $.each(result, function(i, obj) {
                        html += '<option value="'+obj.area_code+'">'+obj.area_name+'</option>';
                    });
                    $("#city").append(html);
                    form.render('select');
                    layer.close(ii);
                }
            });
        });

        form.on('select(city)',function(data){
            var ii = layer.load();
            var city_code = data.value;
            $("#city_name").val($("#city option:selected").text())
            $("#area_name").val('');
            $("#district").html('<option value="">请选择区域</option>');
            form.render('select');
            $.ajax({
                type: "GET",
                url: "/area/get_area_by_parent/"+city_code,
                dataType:"json",
                success: function(result){
                    var html ='';
                    $.each(result, function(i, obj) {
                        html += '<option value="'+obj.area_code+'">'+obj.area_name+'</option>';
                    });
                    $("#district").append(html);
                    form.render('select');
                    layer.close(ii);
                }
            });
        });

        form.on('select(district)',function(data){
            $("#area_name").val($("#district option:selected").text())
        });
    });
</script>
</body>
</html>